<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <h:outputStylesheet library="css" name="myTheme.css"/>
        <title>Meteocal</title>
    </h:head>

    <h:body>
        <p:layout fullPage="true">
            <p:layoutUnit position="north" size="61" styleClass="top">
                
                <h:form style="float: left">
                    <h:commandLink action="home.xhtml?faces-redirect=true">
                        <p:graphicImage library="images" name="logo.png" styleClass="logo"/>
                    </h:commandLink>
                </h:form>
                
                <h:form id="searchForm">
                    <p:growl id="searchMessage" showDetail="true"/>
                        <p:autoComplete id="otherCalendar" value="#{searchCalendarBean.username}" 
                                        completeMethod="#{searchCalendarBean.completeText}"
                                        style="padding-right: 10px">
                            <p:ajax event="itemSelect" listener="#{searchCalendarBean.onItemSelect}"
                                    update="searchMessage" />
                        </p:autoComplete>
                        <p:commandButton icon="ui-icon-search" type="submit" 
                                         action="#{searchCalendarBean.searchAnotherCalendar()}" 
                                         update="searchMessage"/>
                </h:form>
                

                <h:form id="optionsForm">
                    <p:menuButton id="options" value="Options">
                        <p:menuitem value="Settings" action="settings.xhtml?faces-redirect=true"
                                    icon="ui-icon-person"/>
                        <p:separator />
                        <p:menuitem value="Logout" action="#{loginBean.logout()}" 
                                    icon="ui-icon-power"/>
                    </p:menuButton>
                </h:form>
                
                <h:form id="greetings">
                    Hi #{userBean.loggedUser.username}!
                </h:form>
                
            </p:layoutUnit>
            
            <p:layoutUnit position="center" styleClass="contentLayout">
                <ui:insert name="content"/>
            </p:layoutUnit>
            </p:layout>
    </h:body>
</html>
